import Layout from '@/layout/index.vue'

const asyncRoutes = [
  {
    path: '/order',
    name: 'Order',
    component: Layout,
    meta: {
      title: '订单管理',
      icon: 'nav-icon icon-order',
      resourceId: 'route:/web/order-management/',
    },
    children: [
      {
        path: '/order/list',
        name: 'OrderList',
        component: () => import('@/views/order/index.vue'),
        meta: {
          title: '充电订单',
          resourceId: 'route:/web/order-management/charge-order-management/',
        },
      },
      {
        path: '/order/detail/:id',
        name: 'OrderDetail',
        component: () => import('@/views/order/detail.vue'),
        hidden: true,
        meta: {
          title: '订单详情',
          activeMenu: '/order',
          resourceId: 'route:/web/order-management/', //todo
          key: (route) => `${route.params.id}`,
        },
      },
      {
        path: '/order/timeslice/:deviceId/:billNum',
        name: 'OrderTimeslice',
        component: () => import('@/views/order/timeslice.vue'),
        hidden: true,
        meta: {
          title: '充电记录时间片',
          resourceId: 'route:/web/order-management/timeslice/', //todo
          key: (route) => `${route.params.deviceId}${route.params.billNum}`,
        },
      },
      {
        path: '/order/cardList',
        name: 'OrderCardList',
        component: () => import('@/views/order/cardList.vue'),
        meta: {
          title: '套餐订单',
          resourceId: 'route:/web/order-management/cardList/', //todo
        },
      },
      {
        path: '/order/cardDetail',
        name: 'OrderCardDetail',
        component: () => import('@/views/order/cardDetail.vue'),
        hidden: true,
        meta: {
          title: '套餐订单详情',
          resourceId: 'route:/web/order-management/cardDetail/', //todo
        },
      },
      {
        path: '/order/timeCardList',
        name: 'OrderTimeCardList',
        component: () => import('@/views/order/timeCardList.vue'),
        meta: {
          title: '时长卡订单',
          resourceId: 'route:/web/order-management/timecard-order-management/',
        },
      },
      {
        path: '/order/timeCardDetail/:type/:id',
        name: 'OrderTimeCardDetail',
        component: () => import('@/views/order/timeCardDetail.vue'),
        hidden: true,
        meta: {
          title: '时长卡详情',
          activeMenu: '/order',
          resourceId:
            'route:/web/order-management/timecard-order-management/timecard-detail/',
          key: (route) => `${route.params.type}${route.params.id}`,
        },
      },
      {
        path: '/order/andEnergyList',
        name: 'OrderAndEnergyList',
        component: () => import('@/views/order/andEnergyList.vue'),
        meta: {
          title: '和能量订单',
          resourceId: 'route:/web/order-management/andEnergyCard-management/',
        },
      },
      {
        path: '/order/andEnergyDetail/:id',
        name: 'OrderAndEnergyDetail',
        component: () => import('@/views/order/andEnergyDetail.vue'),
        hidden: true,
        meta: {
          title: '和能量详情',
          activeMenu: '/order',
          resourceId:
            'route:/web/order-management/andEnergyCard-management/andEnergyCard-detail/',
          key: (route) => `${route.params.type}${route.params.id}`,
        },
      },
    ],
  },
]
export default asyncRoutes
